import { createMessage } from './methods';
import { VNode, ComponentInternalInstance } from "vue";

export interface MessageProps {
    message?: string | VNode;
    duration?: number; // 经过多长时间才关闭，如果是0，就一直显示，不关闭
    showClose?: boolean;
    type?: 'primary' | 'info' | 'success' | 'warning';
    onDestroy: () => void;
    id: string;
    offset?: number; // 偏移位置
    zIndex: number;
    transitionName?: string // 动画名称
}
export interface MessageContext {
    id: string;
    vnode: VNode;
    vm: ComponentInternalInstance;
    props: MessageProps;
    destroy: () => void;

}

export type CreateMessageProps = Omit<MessageProps, 'onDestroy' | 'id' | 'zIndex'>  // 调用的时候不用传入，忽略这个 onDestroy 属性